package com.ruoyi.common.exception.errorCode;

/**
 * 包装器业务异常实现类
 * @auther zcy
 * @date 2019/3/11 15:09
 */
public class CommonException extends Exception implements CommonError {

    private CommonError commonError;

    //直接接收EmErrorCode的传参用于构造业务异常
    public CommonException(CommonError commonError) {
        super();
        this.commonError = commonError;
    }

    //接收自定义errMsg的构造业务异常
    public CommonException(CommonError commonError, String errMsg) {
        super();
        this.commonError = commonError;
        this.commonError.setErrorMsg(errMsg);
    }

    public CommonException(String 无法获取登录用户信息) {
    }

    public CommonException(String s, Exception e) {
    }

    @Override
    public int getErrCode() {
        return this.commonError.getErrCode();
    }

    @Override
    public String getErrMsg() {
        return this.commonError.getErrMsg();
    }

    @Override
    public CommonError setErrorMsg(String errMsg) {
        return this.commonError.setErrorMsg(errMsg);
    }
}
